package com.cqut.entity;

import java.util.Date;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;

import com.sun.istack.internal.NotNull;

/**
 * 日程实体
 * 
 * @author yangxun
 * 
 */
@Entity
public class Schedule {
	
	@Id
	@GeneratedValue
	private long id;// 日程ID
	
	@Column(length=20)
	private String name;// 任务名称
	@Column
	private Date startTime;// 开始时间
	@Column
	private Date endTime;// 结束时间
	
	@Column
	private String descri;// 留言内容
	
	@Column(length=2)
	private int state;// 当前状态 0：未读 1：已读 2：删除
	
	@Column
	private Date remainTime;// 提醒时间

	@ManyToMany(fetch=FetchType.LAZY,cascade=CascadeType.ALL)
	@JoinColumn(name="abandEmployee")
	private Set<Employee> abandEmployee;//授权给你的人员

	@ManyToMany(fetch=FetchType.LAZY,cascade=CascadeType.ALL)
	@JoinColumn(name="rightEmployee")
	private Set<Employee> rightEmployee;//你授权的人员
	
	public Set<Employee> getRightEmployee() {
		return rightEmployee;
	}

	public void setRightEmployee(Set<Employee> rightEmployee) {
		this.rightEmployee = rightEmployee;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	public String getDescribe() {
		return descri;
	}

	public void setDescribe(String descri) {
		this.descri = descri;
	}

	public int getState() {
		return state;
	}

	public void setState(int state) {
		this.state = state;
	}

	public Date getRemainTime() {
		return remainTime;
	}

	public void setRemainTime(Date remainTime) {
		this.remainTime = remainTime;
	}
	public Set<Employee> getEmployeeID() {
		return abandEmployee;
	}
	
	public void setEmployeeID(Set<Employee> employeeID) {
		this.abandEmployee = employeeID;
	}


}
